<?php
/**
 * @Author: kendy
 * @Date:   2019-11-04 14:10:00
 * @Last Modified by:   jiayanting
 * @Last Modified time: 2019-11-08 15:43:28
 */
namespace app\common\model;

use think\Db;
use think\Model;

/**
 * Class LogOrderModel
 * @package app\common\model
 * 订单日志模型类
 */
class LogOrderModel extends Model
{ 
  // 数据库表名
    protected $table = 'log_orders';
    /**
     * @param $orderId      订单id
     * @param $userId       用户id
     * @param $logContent   日志内容
     * @param $orderStatus  订单状态
     * 记录订单日志
     */
    public function addLogOrder($orderId,$orderType, $userId, $orderStatus, $logContent)
    { 

           $logOrder['order_id'] = $orderId;
           $logOrder['order_type'] = $orderType;
           $logOrder['order_status'] = $orderStatus;
           $logOrder['log_content'] = $logContent;
           $logOrder['user_id'] = $userId;
           $logOrder['create_time'] = time();
           Db::name($this->table)->insert($logOrder);
    }

}